package main

import (
	"fmt"
	"log"
	"runtime"

	"goEmqxToDb/service"
	"goEmqxToDb/tray"
)

func main() {
	fmt.Printf("GoEmqxToDb starting on %s...\n", runtime.GOOS)

	switch runtime.GOOS {
	case "windows":
		fmt.Println("Running in Windows tray mode...")
		tray.RunTray()
	case "linux":
		fmt.Println("Running in Linux daemon mode...")
		service.RunAsDaemon()
	default:
		fmt.Printf("Running in direct mode for %s...\n", runtime.GOOS)
		service.Run()
	}
}

func init() {
	log.SetFlags(log.LstdFlags | log.Lshortfile)
} 